<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //此时这个Person还未被调用
        function Person(firstname,lastname,age){
            //这个this现在指向的是Person这个实例
            this.firstname=firstname;
            this.lastname=lastname;
            this.age=age;
        }
        //在Person这个原型添加了一个getFullName函数（方法）
        Person.prototype.getFullName=function(){
            return `${this.firstname} ${this.lastname}`;
        }
        var Person1 = new Person('ja','hh',24);
        console.log(Person1);
        console.log(Person1.getFullName());
    </script>
</body>
</html>